#include <bits/stdc++.h>

using namespace std;
const int N=100005;
int a[N];

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,j=0;
    cin>>n;
    int ans=n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }



    for(int i=1;i<=n;i++){
        for(j=0;j<=n-1;j++){
            if(a[j]>a[j+1]){
                swap(a[j],a[j+1]);
            }
        }
        j=0;
    }

    for(int i=1;i<=n;i++){
        if(a[i]<a[i+1]){
            ans--;
            a[i]=N;

        }
    }


  //for(int i=1;i<=n;i++){
  //     cout<<a[i]<<" ";
  // }
cout<<ans-1;
    return 0;
}
